import java.util.Scanner;

public class Test {
    public static int getNum(int n){
        int sum = 0;
        while(n > 1){
            sum += n/3;
            n = n/3 + n%3;
            if(n == 2){
                sum++;
                break;
            }
        }
        return sum;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(getNum(n));
    }
    public static int func(int m){
        int sum = 1;
        int a = 1;
        int b = 1;
        for (int i = 3; i <= m; i++) {
            sum = a + b;
            a = b;
            b = sum;
        }
        return sum;
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            System.out.println(func(n));
        }
    }
}
